package org.cargloss.cp.controller.modul.ourcustomer;

import org.cargloss.cp.controller.modul.PageController;
import org.cargloss.cp.model.OurCustomer;

import util.hibernate.DAO;

import com.opensymphony.xwork2.ActionSupport;



public class ActionPage extends ActionSupport {
	/**
	 * 
	 */
	private static final long serialVersionUID = 1L;
	PageController pageControl = new PageController();
	private OurCustomer ourCustomer;
	private int id;

	public String execute() {
		pageControl.setNavText("OurCustomer");
		pageControl.setAll(false);
		pageControl.setHeader(true);
		pageControl.setMainMenu(true);
		return SUCCESS;
	}

	public String add() {
		return SUCCESS;
	}

	public String search() {
		return SUCCESS;
	}
	
	public String uploader() {
		return SUCCESS;
	}
	public String delete() {
		getObject();
		return SUCCESS;
	}

	public void getObject() {
		DAO<Integer> dao = new DAO<Integer>();
		dao.createCriteria(OurCustomer.class);
		dao.addFilter("eq", "id", id);
		ourCustomer = (OurCustomer) dao.findUnique();
	}

	public String edit() {
		getObject();
		return SUCCESS;
	}

	public String detail() {
		getObject();
		return SUCCESS;
	}

	public String ourCustomer() {
		getObject();
		return SUCCESS;
	}
	
	public String preview() {
		getObject();
		return SUCCESS;
	}

	public int getId() {
		return id;
	}

	public void setId(int id) {
		this.id = id;
	}

	public PageController getPageControl() {
		return pageControl;
	}

	public void setPageControl(PageController pageControl) {
		this.pageControl = pageControl;
	}

	public OurCustomer getOurCustomer() {
		return ourCustomer;
	}

	public void setOurCustomer(OurCustomer ourCustomer) {
		this.ourCustomer = ourCustomer;
	}
}
